package 树;

public class Demo09 {
    /*
    * 遍历整个二叉树
    * */
    static class Solution {
        public int countNodes(TreeNode root) {
            if(root == null){
                return 0;
            }
            return countNodes(root.left)+countNodes(root.right)+1;
        }
    }
}
